# momentaryButton object example

The following example shows the momentaryButton object:

`<momentaryButton name="MomentaryPushButton2" height="59" width="111" left="17" top="72" visible="true" wallpaper="false" isReferenceObject="false" audio="true" backStyle="solid" borderStyle="raised" borderUsesBackColor="false" borderWidth="4" buttonAction="normallyOpen" description="Momentary PB2" holdTime="250" highlightColor="lime" horizontalMargin="0" verticalMargin="0" shape="rectangle" touch="true" currentStateId="0" captionOnBorder="False" keyAssignment="F16">`

`<states>`

`<state stateId="Error" backColor="navy" borderColor="navy" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Arial" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="Error" color="white" backColor="navy" backStyle="transparent" alignment="middleCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="" alignment="middleCenter" backStyle="transparent" color="white" backColor="navy" scaled="false" blink="false" />`

`</state>`

`<state stateId="0" backColor="#8C008C" borderColor="#004000" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Georgia" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="Momentary No State" color="#FFC0FF" backColor="navy" backStyle="transparent" alignment="topCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="Backspace" alignment="bottomLeft" backStyle="transparent" color="#F00000" backColor="navy" scaled="false" blink="false" />`

`</state>`

`<state stateId="1" backColor="navy" borderColor="navy" patternColor="white" patternStyle="none" blink="false">`

`<caption fontFamily="Arial" fontSize="10" bold="false" italic="false" underline="false" strikethrough="false" caption="" color="white" backColor="navy" backStyle="transparent" alignment="middleCenter" wordWrap="true" blink="false" />`

`<imageSettings imageName="" alignment="middleCenter" backStyle="transparent" color="white" backColor="navy" scaled="false" blink="false" />`

`</state>`

`</states>`

`<animations>`

`<animateVisibility expression="TagS2" expressionTrueState="visible" />`

`</animations>`

`<connections>`

`<connection name="Value" expression="TagS2" />`

`<connection name="Indicator" expression="TestS2" />`

`</connections>`

`</momentaryButton>`

## See also

Push button objects: momentaryButton object

momentaryButton object attributes and elements